package com.google.code.roadmap.web.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.google.code.roadmap.service.RoadMapService;
import com.google.code.roadmap.web.domain.RoadMap;

/**
 * @author ParkHaeCheol
 */
@Controller()
public class RoadMapController {

	/**
	 * UserService
	 */
	@Resource(name = "roadMapService")
	private RoadMapService roadMapService;
	
	

	/**
	 * 로드맵 가지고 오기
	 */
	@RequestMapping("/roadmap/roadMap.do")
	public ModelAndView handleInsertGoodWriter(
			HttpServletRequest req,
			@RequestParam(value = "idNum", required = false) Integer idNum) {

		RoadMap roadMap=roadMapService.getRoadMap(idNum);
		
		// 경로 설정 및 Attribute 설정
		ModelAndView mav = new ModelAndView();
		mav.setViewName("roadmap/roadmap");
		mav.addObject("roadMap", roadMap);

		return mav;

	}

}
